package cn.lovecyy.mockjson.plugins;

import cn.hutool.core.thread.ThreadUtil;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * HotDeployTest
 *
 * @author Yakir
 */
public class HotDeployTest {

	public static void main(String[] args) {
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
		DefaultListableBeanFactory defaultListableBeanFactory = (DefaultListableBeanFactory) applicationContext
				.getAutowireCapableBeanFactory();
		while (true) {
			try {
				HotDeploy.hotDeployWithReflect();
				// hotDeployWithSpring();
				// delete();
			}
			catch (Exception e) {
				e.printStackTrace();
				ThreadUtil.sleep(1000 * 10);
			}
		}
	}

}
